﻿#region Using Declarations

using System.Web;
using Infrastructure.Storage;

#endregion

namespace SocialFront.Core.Persistence 
{
    // Creates the appropriate storage for the appropriate runtime environment.
    public class DataContextStorageFactory
    {
        private static IStorage _storage;

        public static IStorage GetStorage()
        {
            if (_storage == null)
            {
                if (HttpContext.Current != null)
                    _storage = Facade.HttpContextStorage;
                else
                    _storage = Facade.ThreadStorage;
            }
            return _storage;
        }
    }
}
